<template>
  <common-crud ref="sysRole" :crudOptionProps="crudOptionProps2" @listAfter="listAfter"></common-crud>
</template>

<script>
import commonCrud from "@/components/commonCrud/CommonCrud.vue"
import {baseUrl} from "../../../config/env";

export default {
  name: "sysRole",
  components: {commonCrud},
  data() {
    return {

      // 表配置
      crudOptionProps2: {
        name: 'sys/role',
        apiPrefix: '/system/sysRole',
        permissionOption: {
          enable: true,

        },
        // 是否云原生
        // functionTarget: 'sysRole',
        tableOption: {
          column: [{
            label: "角色名称",
            prop: "roleName",
            search: true,
            required: true

          }, {
            label: "角色编码",
            prop: "roleCode",
            search: true,
            editDisabled: true,
            required: true
          },
            {
              label: "备注",
              prop: "remark",
              search: false,
            },
            {
              label: "菜单",
              prop: 'menus',
              type: 'tree',
              hide: true,
              multiple: true,
              // collapseTags: true,
              // maxCollapseTags: 3,
              // collapseTagsTooltip: true,
              leafOnly: true,
              parent: true,
              dicUrl: baseUrl + '/system/sysMenu/tree',
              dicMethod: "post",
            }
          ]
        },
        buttonList: [
          // {
          //   menuType: "menu",
          //   name: "路由跳转",
          //   icon: "View",
          //   mode: 'router',
          //   permission:'sys:menu:add',
          //   info: {url: '/simpleCrud', props: 'kfc', value: '19090902212'}
          // },
        ]

      }

    }
  }, created() {
    console.log("commoncrud created")
  }, computed() {
    return {
      'search-reset': this.searchChange2,
    }
  }, methods: {
    listAfter(data) {
      console.log("listAfter2", data)
    },

    addBefore2(form) {

      alert(JSON.stringify(form))
      console.log("addBefore")
    },
    addAfter2(data) {

      console.log(data)
      alert(JSON.stringify(data))
    },
    updateBefore2(form) {
      alert(JSON.stringify(form))
    },

  }
}
</script>

<style scoped>

</style>
